package com.tongji.showroom.utils
{
	public class PageAdmin
	{
		private var _itemCount:Number;

		public function get itemCount():Number
		{
			return _itemCount;
		}

		public function set itemCount(value:Number):void
		{
			_itemCount = value;
		}

		private var _pageSize:Number;

		public function get pageSize():Number
		{
			return _pageSize;
		}

		public function set pageSize(value:Number):void
		{
			_pageSize = value;
		}

		/**
		 * 计算总页数
		 * @param itemCount 项目总数
		 * @param pageSize  每页显示数
		 * @return 总页数
		 * 
		 */		
		public function getPageCount(itemCount:Number, pageSize:Number):Number
		{
			this.itemCount = itemCount;
			this.pageSize = pageSize;
			var pageCount:Number = 0;
			
			if (itemCount % pageSize == 0)
			{
				pageCount = itemCount / pageSize;
			}
			else
			{
				pageCount = itemCount / pageSize + 1;
			}
			return pageCount;
		}
		
		public function PageAdmin()
		{
		}
	}
}